<template>
  <div class="car_box">
    <Car v-if="isshow">
      <template #echarts></template>
    </Car>
    <h2 style="text-align: center" v-if="!isshow">{{ message }}</h2>
  </div>
</template>

<script>
import cars from '@/views/cars'
export default {
  created() {
    this.Tips()
  },
  components: {
    Car: cars
  },
  data() {
    return {
      content: 'hahahha',
      isshow: true,
      message: ''
    }
  },
  methods: {
    Tips() {
      const tokens =
        'dcsacunhascsauicasciuancasinciascacnscqwrurwqidjaodjqwidja'
      const Tips =
        localStorage.token == tokens ? '登录过期,请重新登录' : '请登录后查看'
      if (localStorage.status != 20001 || localStorage.token != tokens) {
        this.isshow = false
        this.message = `${Tips}`
      } else {
        this.isshow = true
      }
    }
  }
}
</script>

<style lang="less" scoped>
.car_box {
  position: absolute;
  height: calc(100% - 2.667rem);
  width: 100%;
  // border: 1px dashed red;
}
</style>
